{extend name="base"}
{block name="title"}代理返点记录{/block}
{block name="head"}
<style>
  .border-table tbody th{text-align:center; color:#333; font-weight:400; padding-left:5px;}
  .border-table{font-size:12px; color:#666;}
  .border-table th, .border-table td{text-align:center; padding:0 4px;}
</style>
{/block}
{block name="body"}
<body class="mainbody">
<form>
  <!--导航栏-->
  <div class="location">
    <a href="javascript:history.back(-1);" class="back"><i class="iconfont icon-up"></i><span>返回上一页</span></a>
    <a href="{:url('index/home')}" class="home"><i class="iconfont icon-home"></i><span>首页</span></a>
    <i class="arrow iconfont icon-arrow-right"></i>
    <span>代理返点记录</span>
  </div>
  <!--/导航栏-->

  <!--工具栏-->
  <div id="floatHead" class="toolbar-wrap">
    <div class="toolbar">
      <div class="box-wrap">
        <a class="menu-btn"><i class="iconfont icon-more"></i></a>
        <div class="l-list">
          <div class="menu-list">
            <div class="rule-single-select">
              <select name="channel" style="display:none">
                <option value="-1">===所有渠道===</option>
                {volist name="CHANNELS" id="val"}
                <option value="{$key}"{eq name="channel" value="$key"} selected{/eq}>[{$key}]{$val.Name}</option>
                {/volist}
              </select>
            </div>
            <div class="rule-single-select">
              <select name="AgentType" style="display:none">
                <option value="-1">===所有地区===</option>
                {volist name="AGENT_TYPE" id="val"}
                <option value="{$key}"{eq name="AgentType" value="$key"} selected{/eq}>[{$key}]{$val}</option>
                {/volist}
              </select>
            </div>
            <input type="text" class="input rule-date-input" id="time1" autocomplete="off" {literal}onclick="WdatePicker({maxDate:'#F{$dp.$D(\'time2\')}'})"{/literal} name="time1" value="{$time1|default=''|substr=0,19}" placeholder="返点起始日期" /> -
            <input type="text" class="input rule-date-input" id="time2" autocomplete="off" {literal}onclick="WdatePicker({minDate:'#F{$dp.$D(\'time1\')}', maxDate:'%y-%M-%d'})"{/literal} name="time2" value="{$time2|default=''|substr=0,19}" placeholder="返点结束日期" />
            <input type="text" class="input" autocomplete="off" name="search" value="{$search|default=''|htmlentities}" placeholder="订单号/UserID/GameID/昵称" />
            <input type="text" class="input small" autocomplete="off" name="yqcode" value="{$yqcode|default=''|htmlentities}" placeholder="邀请码" />
            <a class="btn-search"><i class="iconfont icon-search"></i></a>
          </div>
        </div>
        <div class="r-list">
          <label style="color:#f00;">
            充值:{:number_format($totalRMB, 2, '.', '')}
            返点:{:number_format($totalRebate, 2, '.', '')}
            业绩:{:number_format($totalRMB - $totalRebate, 2, '.', '')}
          </label>
        </div>
      </div>
    </div>
  </div>
  <!--/工具栏-->

  <!--列表-->
  <div class="table-container">
    <table class="ltable border-table">
      <tr>
        <th>渠道</th>
        <th>订单号</th>
        <th>充值用户</th>
        <th>推广员</th>
        <th>返点等级</th>
        <th>充值金额</th>
        <th>返点金额</th>
        <th>返点比率</th>
        <th>返点时间</th>
      </tr>
{empty name="list"}
      <tr><td colspan="9">Oh~暂无数据!</td></tr>
{else}
      {volist name="list" id="v"}
      <tr>
        <td title="{$v.Channel}">{$CHANNELS[$v.Channel]['Name'] ?? '--'}</td>
        <td><a target="_blank" href="{:url('user.pay/index')}?search={$v.MerBillNo}">{$v.MerBillNo}</a></td>
        <td class="user-avatar">
          <a target="_blank" href="{:url('user.detail/index')}?UserID={$v.UserID}">
            <img src="{$v.HeadImgUrl?:'__STATIC__/houtai/images/dface.png'}" />
          </a>
          <div class="user-box">
            <h4><a target="_blank" class="at_{$v.AccountsType}" href="{:url('user.detail/index')}?UserID={$v.UserID}">{:htmlentities($v.NickName)}</a></h4>
            <i>{$v.GameID}</i>
          </div>
        </td>
        <td class="user-avatar">
          <div class="user-box">
            <h4><a target="_blank" class="red" href="{:url('user.detail/index')}?UserID={$v.AgentID}">{:htmlentities($v.AgentCompellation)}[{$v.AgentLevel}级]</a></h4>
            <i>{$v.AgentGameID}</i>
          </div>
        </td>
        <td class="tr">{$v.myAgentLevel}</td>
        <td class="tr">{$v.RMB}</td>
        <td class="tr">{$v.myRebate}</td>
        <td class="tr">{$v.myLevel}%</td>
        <td>{$v.Addtime}</td>
      </tr>
      {/volist}
{/empty}
    </table>
  </div>
  <!--/列表-->

  <!--内容底部-->
  <div class="page-footer"><div class="btn-wrap">{$list->render()}</div></div>
  <!--/内容底部-->

</form>
</body>
{/block}